home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / database / convr704.zip / BRUCEINI.DOC < prev    next >
Text File  |  1997-04-28  |  13KB  |  300 lines

  1. BRUCEINI.DOC                           1                           Apr 28, 1997
  2.  
  3. This text file describes using an *.INI  file  or  environmental  variables  to
  4. override the system defaults for this and other programs by  the  same  author.
  5. Both of these are always optional but they can be very useful.
  6.  
  7. - - - - - - - - - - - - - - - - -  INI files  - - - - - - - - - - - - - - - - -
  8.  
  9. 1.1 What is an INI file?
  10.  
  11.      An INI file is a way of specifying parameters for a program that you don't
  12.      want to have to respecify from the command line each  time.   This  allows
  13.      you to override any program defaults you want to change.
  14.  
  15.      This is very useful if you disagree with the defaults I've established for
  16.      the routines.  It is also useful in cases  where  you  typically  use  the
  17.      command one way but in fairly regular cases you need to  run  the  command
  18.      using a whole bunch of different parameters.  You can set up one INI  file
  19.      for your standard usage and then provide a different INI  file  when  it's
  20.      time to run the lesser used versions.
  21.  
  22. 1.2 What's the default INI file name for each program?
  23.  
  24.      Each of the programs reads an INI file if it can find  one.   By  default,
  25.      the INI file that is searched for is based on the  executable's  name  but
  26.      not always. This is shown  below  (block  declarations  are  described  in
  27.      1.3(c) below; environmental variables are described in section 2.1 below):
  28.  
  29.              Routine         INI file        Block           Environmental
  30.                                                              Variable
  31.  
  32.              AV.EXE          AV.INI          [AV]            AV
  33.              BFIND.EXE       BFIND.INI       [BFIND]         BFIND
  34.              CHANGE.EXE      CHANGE.INI      [CHANGE]        CHANGE
  35.              CONVERT.EXE     CONVERT.INI     [CONVERT]       CONVERT
  36.              COPSINCE.EXE    COPSINCE.INI    [COPSINCE]      COPSINCE
  37.              DATES.EXE       DATES.INI       [DATES]         DATES
  38.              DIRCOMP.EXE     DIRCOMP.INI     [DIRCOMP]       DIRCOMP
  39.              DIRTOTAL.EXE    DIRTOTAL.INI    [DIRTOTAL]      DIRTOTAL
  40.              EUMAIL.EXE      EUMAIL.INI      [EUMAIL]        EUMAIL
  41.              FILL.EXE        FILL.INI        [FILL]          FILL
  42.              FILUPDAT.EXE    FILUPDAT.INI    [FILUPDAT]      FILUPDAT
  43.              FIXTEXT.EXE     FIXTEXT.INI     [FIXTEXT]       FIXTEXT
  44.              FORTUNE.EXE     FORTUNE.INI     [FORTUNE]       FORTUNE
  45.              HTMSTRIP.EXE    HTMSTRIP.INI    [HTMSTRIP]      HTMSTRIP
  46.              ISAMFIND.EXE &
  47.                ISAMMAKE.EXE  ISAMFIND.INI    [ISAMFIND]      ISAMFIND
  48.              MOZ.EXE         MOZ.INI         [MOZ]           MOZ
  49.              PAGINATE.EXE    PAGINATE.INI    [PAGINATE]      PAGINATE
  50.              READ.EXE &
  51.                READINIT.EXE &
  52.                READMAKE.EXE &
  53.                READY.EXE     READ.INI        [READ]          READ
  54.              TXTABLE.EXE     TXTABLE.INI     [TXTABLE]       TXTABLE
  55.  
  56.  
  57. BRUCEINI.DOC                           2                           Apr 28, 1997
  58.  
  59. 1.3 What does an INI file look like?
  60.  
  61.      The INI file is an ASCII text file that can be created maintained by hand.
  62.      The commands in the INI file should begin in column 1.  It can consist of:
  63.  
  64.      (a) Command-line parameters
  65.      (b) Comments
  66.      (c) Block declarations
  67.      (d) Special items (vary by routine)
  68.  
  69.      (a)  Command-line parameters:  The INI file can consist  or  one  or  more
  70.           command line parameters.   In  most  cases,  it  can  *only*  include
  71.           command line parameters that begin with a slash  ("/").   These  will
  72.           vary by routine of course but, in READ for  example,  your  INI  file
  73.           might appear like this:
  74.  
  75.              /MONO
  76.              /-DOS
  77.              /COLOR=123 134 145 156
  78.  
  79.      (b)  Comments:  The INI file can also contain comment  lines.   These  are
  80.           defined as any lines that are blank or begin with a semi-colon.
  81.  
  82.      (c)  Block declarations:  You can combine INI files if you'd  like.   This
  83.           saves some disk space.  Typically, this is done  in  connection  with
  84.           the SET BG=inifile environmental parameter (described below).  Blocks
  85.           are declared by using the name of searched-for routine  in  brackets.
  86.           (See the table above to see what blocks are  searched  for  for  each
  87.           routine.) Any statements between one block and the next  are  assumed
  88.           to be associated with the first routine.  For example:
  89.  
  90.              ; ALL.INI -- contains all of the INI statements
  91.              [DATES]
  92.              /SORT
  93.              [FILL]
  94.              /ON
  95.              /SPLIT
  96.              [READ]
  97.              /MONO
  98.  
  99.      (d)  Special  items:   Some  routines  allow  the  INI  file  to   include
  100.           statements that cannot be specified from  the  command  line.   These
  101.           special  statements  are  described   in   the   specific   routine's
  102.           documentation.
  103.  
  104.      A fairly complicated example might be an INI file used  for  the  HTMSTRIP
  105.      program.  In this case, you might find  all  of  the  following  types  of
  106.      lines:
  107.  
  108.              (blank line)   ignored as comment
  109.              ;xxxxx         ignored as comment
  110.              [xxxxx]        beginning of program block (e.g. "[HTMSTRIP]")
  111.              /xxxxx         command-line parameters
  112.              \xxx = \xxx    character-translation entry
  113.              &xxx;= xxx     entity references (HTML translations)
  114.              <xxx> = xxx    how to show certain blocks
  115.  
  116.  
  117. BRUCEINI.DOC                           3                           Apr 28, 1997
  118.  
  119. 1.4 Where does each program look for the INI file?
  120.  
  121.      Each program here looks for an INI file unless instructed otherwise.   The
  122.      logic used is as follows.  Note that the first "hit" wins:
  123.  
  124.      (a)  No INI file is checked for if any of the following is true:
  125.  
  126.              - /-I or /INULL is passed in from the command line
  127.              - /-I or /INULL is passed  in  from  the  routine's  environmental
  128.                parameter (for example, SET READ=/-I)
  129.              - the environmental variable BG is set to  the  value  of  /-I  or
  130.                /INULL (for example, SET BG=/-I)
  131.  
  132.           Most programs accept either /-I or /INULL.  However, several routines
  133.           (BFIND and CHANGE) accept /-I to mean do a  case-insensitive  search.
  134.           For these programs, you *have* to use /INULL instead.
  135.  
  136.      (b)  If a /Iinitfile setting is  passed  in,  the  routine  uses  this  to
  137.           determine the name of the INI file to look for.  Note that  the  file
  138.           name must include a  period  (for  example,  "/ICHANGE.INI")  or  the
  139.           program will skip it.
  140.  
  141.      (c)  The routine looks for an environmental variable BG.  If this variable
  142.           is defined (and it's not set to /-I), then the routine takes this  to
  143.           be the name of the INI file to look for.
  144.  
  145.      (d)  The routine looks for the INI file under the "INI file" name shown in
  146.           the table at the start of this documentation.
  147.  
  148. 1.5 What's the search path sequence for the INI file?
  149.  
  150.      If the INI file name does not include either a drive or path specification
  151.      (for example, you don't pass in something like /IC:\ALL.INI), the  routine
  152.      will search for the named file.  It will check for  it  in  the  following
  153.      places in the following order.  The first place that it finds it wins:
  154.  
  155.         - Your default subdirectory (where  you  were  when  you  executed  the
  156.           command)
  157.         - The subdirectory that contains the EXE that you're executing
  158.         - Your regular DOS path
  159.  
  160.      If you do not have an INI file, this searching can take awhile  especially
  161.      if you have any networked drives in your path.  In this  case,  specifying
  162.      "/-I" will save some time.  Passing in a  fully  qualified  filename  also
  163.      helps.
  164.  
  165.  
  166. BRUCEINI.DOC                           4                           Apr 28, 1997
  167.  
  168. 1.6 I'm lost.  What does your INI file look like?
  169.  
  170.      Personally, I have a common INI file named WAYNE.INI in the root of my  C:
  171.      drive.  I put it there so I  don't  run  out  of  environmental  space  by
  172.      specifying  some  huge  path.   I  have  the  following  statement  in  my
  173.      AUTOEXEC.BAT:
  174.  
  175.           SET BG=C:\WAYNE.INI
  176.  
  177.      Currently, my C:\WAYNE.INI file looks like this:
  178.  
  179.           [AV]
  180.           /on
  181.           [bfind]
  182.           /-empty
  183.           [COPSINCE]
  184.           /def text=*.bas *.bi *.c *.diz *.doc *.h *.ref *.sas *.sc *.txt
  185.           /def prg=*.bas *.bat *.bi *.c *.h *.sas
  186.           /to c:\temp
  187.           /replace
  188.           /-beep
  189.           /text
  190.           /copy -0
  191.           [DATES]
  192.           /cc:\mine\datemine.txt
  193.           /sort
  194.           /day
  195.           /-i
  196.           [FILL]
  197.           /letter
  198.           [htmstrip]
  199.           /lc:\vbdos\htmstrip.ini
  200.           /-symbols
  201.           /warnings
  202.           [paginate]
  203.           /overwrite
  204.           /cc:\bat\brucedoc.ctl
  205.           [txtable]
  206.           /debug
  207.  
  208.      If I ever need to override the WAYNE.INI settings,  it's  easy  to  do  by
  209.      passing them in from the command  line  or  by  specifying  /-I  from  the
  210.      command line.
  211.  
  212.  
  213. BRUCEINI.DOC                           5                           Apr 28, 1997
  214.  
  215. - - - - - - - - - - - -  Using Environmental variables  - - - - - - - - - - - -
  216.  
  217. 2.1 Introduction
  218.  
  219.      The programs all allow you to pass in regular DOS environmental variables,
  220.      either from the command line or from the INI file.  These  variables  will
  221.      be resolved by the program.  Under Windows 95 and 4DOS, the variables  are
  222.      resolved by the operating system instead.
  223.  
  224. 2.2 What are environmental variables?
  225.  
  226.      The DOS environment is a shared area of memory that is  used  for  setting
  227.      certain values that one or more program  might  need.   These  values  are
  228.      retrieved by examining a given environmental variable which  has  specific
  229.      information that a program might want.
  230.  
  231.      To see you environmental variables, type "SET" from  the  DOS  prompt  and
  232.      press <ENTER>.  This will return a listing of the environmental  variables
  233.      and their values.  For example:
  234.  
  235.         C:\>SET<ENTER>
  236.         CONFIG=NORMAL
  237.         BG=C:\WAYNE.INI
  238.         BLASTER=A220 I5 D1 H5 P320 Q2 T4
  239.         COMSPEC=C:\COMMAND.COM
  240.         CPAV=D:\PCT\DATA\CPAV.INI
  241.         CPBACKUP=D:\PCT\DATA
  242.         LINK=/SE:256
  243.         PATH=C:\DOS;C:\BAT;C:\;C:\UTIL;C:\UTIL\COPY;C:\UTIL\80386;C:\VBDOS;C:\UTIL\GRAPHICS;D:\PCT;E:\WINDOWS
  244.         PCTOOLS=D:\PCT\DATA
  245.         PROMPT=$p$g
  246.         TEMP=E:\TEMP
  247.         C:\>
  248.  
  249.      Environmental variables can be set by saying "SET variable=value" such as:
  250.  
  251.         SET PROMPT=$p$g
  252.  
  253.  
  254. 2.3 Aren't there special environmental variables for these routines?
  255.  
  256.      (a)  Each routine has a default environmental  variable  that  is  checked
  257.           when the program runs.  See the table in section 1.2 above  for  more
  258.           information about this.
  259.      (b)  Each routine also checks an environmental variable BG for it's value.
  260.  
  261.  
  262. BRUCEINI.DOC                           6                           Apr 28, 1997
  263.  
  264. 2.4 Other than the special ones above,  how  would  you  use  an  environmental
  265. variable in these routines?
  266.  
  267.      Pass in the variable as "%variable%" as part of the regular parameter list
  268.      (or in the INI file  or  whatever)  and  the  programs  will  resolve  the
  269.      variable to its assigned value for you.  For example:
  270.  
  271.              C:\>SET USER=BGuthrie
  272.              C:\>BFIND %USER% SYSTEM.INI
  273.  
  274.      Will cause the BFIND program to search for the string "BGuthrie"  when  it
  275.      is run.  The routine leaves intact any variables that are not defined.
  276.  
  277.      If you wish to turn off resolution of the environmental variables, pass in
  278.      the parameter /-ENV.
  279.  
  280. 2.5 Can I assign something with an equal sign in the value?
  281.  
  282.      Environmental variables can't contain equal signs since these are used for
  283.      the assignment itself.  If you need to use an equal sign, put a  comma  in
  284.      instead and my programs will translate it as an equal sign for you.   This
  285.      will not affect  any  comma  within  a  quoted  string.   Note  that  this
  286.      convention is not standard within DOS so it's only going to work in  these
  287.      specific programs.
  288.  
  289. - - - - - - - - - - - - - - - - - - Author - - - - - - - - - - - - - - - - - -
  290.  
  291.                 Bruce Guthrie
  292.                 Wayne Software
  293.                 113 Sheffield St.
  294.                 Silver Spring, MD 20910
  295.  
  296.                 fax: (301) 588-8986
  297.                 e-mail: bguthrie@nmaa.org
  298.                 http://www.geocities.com/SiliconValley/Lakes/2414
  299. 
  300.